package com.eerl.pdev.terminal.cmd;

import com.eerl.pdev.MySettingsState;
import com.eerl.pdev.util.EToolPluginConsoleToolWindowFactory;
import com.eerl.pdev.util.Notice;
import com.intellij.notification.NotificationType;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;

public class TerminalEnvPrint extends AnAction {

    public TerminalEnvPrint() {super("Env Print", "", null);}

    @Override
    public void actionPerformed(@NotNull AnActionEvent e) {
        Project project = e.getProject();
        if (project == null) {
            Notice.showNotification(e, "get project is null.....", NotificationType.ERROR);
            return;
        }
        EToolPluginConsoleToolWindowFactory.printToConsole(
            project,
            String.format(
                "isDebug: %s, terminal instance: %s",
                MySettingsState.getInstance().Is_DEBUG,
                Terminal.getInstance(project).toString()
            )
        );
    }
}
